package library_system.demo;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author haomin
 * @date 2022/04/05 22:07
 **/
public class DateDemo {
    public static void main(String[] args) {
        Date date = new Date(); // 当前时间
        System.out.println(date);

        DateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        String s = df.format(date);
        System.out.println(s);
    }
}